// Toolbar.h provides the attributes of the Toolbar class
//-----------------

#if !defined( ToolbarH)
#define ToolbarH

//-----------------
// Includes various libraries and files
#include <cassert>		// for asserts
#include <d3dx9.h>		// Direct 3D library (for all Direct 3D functions)
#include <string>

#include "MeshOrthographic.h"
#include "Window.h"
//-----------------

// enum for the textures
const enum enum_textures_ {
	TEXTURE_BACKGROUND,
	TEXTURE_BORDER,
	TEXTURE_CORNER,
	TEXTURE_ALL
};


// constant for the width of the border
const int BORDER_WIDTH( 20);

class Toolbar {
	public:
		// constructor and destructor
		Toolbar();
		virtual ~Toolbar();

		// accessors
		bool mouseover_toolbar( const int& x, const int& y) const;
		virtual bool mouseover_border( const int& x, const int& y) const = 0;

		virtual void get_button_coordinates( const int& b, int& x, int& y) const = 0;

		float get_x() const;
		float get_y() const;
		float get_width() const;
		float get_height() const;

		// mutators
		void set_x( float x);
		void set_y( float y);
		virtual void set_width( float w);
		void set_height( float h);

		virtual bool mouseover_button( const int& x, const int& y) = 0;
		virtual void set_button_coordinates( const int& b, const int& x, const int& y) = 0;

		HRESULT setup_geometry( LPDIRECT3DDEVICE9 device);
		virtual void render( LPDIRECT3DDEVICE9 device, const Window& window) = 0;

		virtual void reset() = 0;

		const enum enum_ButtonsTextures {
			BUTTON_TEXTURE_PASSIVE,
			BUTTON_TEXTURE_MOUSEOVER,
			BUTTON_TEXTURE_ACTIVE,
			BUTTON_TEXTURE_ALL
		};

		MeshOrthographic orthographic_plane_;
		LPDIRECT3DTEXTURE9 textures_[TEXTURE_ALL];
	private:
		float x_, y_, width_, height_;
};

#endif